package priv.mill.arr;

import java.util.Arrays;
import java.util.Random;

public class ArraySort {


	public static void main(String[] args) {
		long[] arr=new long[15];
		Random random = new Random(37);
		for (int i = 0; i < arr.length; i++) {
			arr[i]=random.nextInt(99);
		}
		System.out.println(Arrays.toString(arr));
		sort(arr);
		System.out.println(Arrays.toString(arr));
		
	}

	private static void sort(long[] arr) {
		int out,in;
		for(out=arr.length;out>0;out--){
			for(in=1;in<out;in++){
				if(arr[in]<arr[in-1]){
					swap(arr, in,in-1);
				}
			}
		}
	}

	private static void swap(long[] arr, int in, int i) {
		long temp=arr[in];
		arr[in]=arr[i];
		arr[i]=temp;
	}
}
